home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Interfaces / AppleScript 1.0 Interfaces / CIncludes / AppleEvents.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-08  |  24.6 KB  |  691 lines  |  [TEXT/MPS ]

  1. /*****************************************************************
  2.  
  3.  Created: Monday, September 16, 1991 at 2:22 PM
  4.  AppleEvents.h
  5.  C Interface to the Macintosh Libraries
  6.  
  7.  Copyright Apple Computer, Inc. 1989-1992
  8.  All rights reserved
  9.  
  10.  Modified for AppleEvents manager version 1.0.1 Nov 13th, 1992
  11.  
  12. *****************************************************************/
  13.  
  14.  
  15. #ifndef __APPLEEVENTS__
  16. #define __APPLEEVENTS__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22. #ifndef __MEMORY__
  23. #include <Memory.h>
  24. #endif
  25.  
  26. #ifndef __OSUTILS__
  27. #include <OSUtils.h>
  28. #endif
  29.  
  30. #ifndef __EVENTS__
  31. #include <Events.h>
  32. #endif
  33.  
  34. #ifndef __EPPC__
  35. #include <EPPC.h>
  36. #endif
  37.  
  38. #ifndef __NOTIFICATION__
  39. #include <Notification.h>
  40. #endif
  41.  
  42. /*--------------------------------------------------------------
  43.         Apple event descriptor types
  44. --------------------------------------------------------------*/
  45.  
  46. enum {                                                        /* compiler limits us to 20 items within an enum */
  47.     typeBoolean = 'bool',                                    /* enum's are used to avoid conflicts with other header files */
  48.     typeChar = 'TEXT',
  49.     typeSMInt = 'shor',
  50.     typeInteger = 'long',
  51.     typeSMFloat = 'sing',
  52.     typeFloat = 'doub',
  53.     typeLongInteger = 'long',
  54.     typeShortInteger = 'shor',
  55.     typeLongFloat = 'doub',
  56.     typeShortFloat = 'sing',
  57.     typeExtended = 'exte',
  58.     typeComp = 'comp',
  59.     typeMagnitude = 'magn',
  60.     typeAEList = 'list',
  61.     typeAERecord = 'reco',
  62.     typeAppleEvent = 'aevt',
  63.     typeTrue = 'true',
  64.     typeFalse = 'fals',
  65.     typeAlias = 'alis',
  66.     typeEnumerated = 'enum'
  67. };
  68.  
  69. enum {
  70.     typeType = 'type',
  71.     typeAppParameters = 'appa',
  72.     typeProperty = 'prop',
  73.     typeFSS = 'fss ',
  74.     typeKeyword = 'keyw',
  75.     typeSectionH = 'sect',
  76.     typeWildCard = '****',
  77.     typeApplSignature = 'sign',
  78.     typeSessionID = 'ssid',
  79.     typeTargetID = 'targ',
  80.     typeProcessSerialNumber = 'psn ',
  81.     typeNull = 'null'                                        /* null or nonexistent data */
  82. };
  83.  
  84. /*--------------------------------------------------------------
  85.         Keywords for Apple event parameters
  86. --------------------------------------------------------------*/
  87.  
  88. enum {
  89.     keyDirectObject = '----',
  90.     keyErrorNumber = 'errn',
  91.     keyErrorString = 'errs',
  92.     keyProcessSerialNumber = 'psn '
  93. };
  94.  
  95. /*--------------------------------------------------------------
  96.         Keywords for Apple event attributes
  97. --------------------------------------------------------------*/
  98.  
  99. enum {
  100.     keyTransactionIDAttr = 'tran',
  101.     keyReturnIDAttr = 'rtid',
  102.     keyEventClassAttr = 'evcl',
  103.     keyEventIDAttr = 'evid',
  104.     keyAddressAttr = 'addr',
  105.     keyOptionalKeywordAttr = 'optk',
  106.     keyTimeoutAttr = 'timo',
  107.     keyInteractLevelAttr = 'inte',                            /* this attribute is read only - will be set in AESend */
  108.     keyEventSourceAttr = 'esrc',                            /* this attribute is read only */
  109.     keyMissedKeywordAttr = 'miss',                            /* this attribute is read only */
  110.     keyOriginalAddressAttr = 'from'                            /* new in 1.0.1 */
  111. };
  112.  
  113. /*--------------------------------------------------------------
  114.         Keywords for special handlers
  115. --------------------------------------------------------------*/
  116.  
  117. enum {
  118.     keyPreDispatch = 'phac',                                /* preHandler accessor call */
  119.     keySelectProc = 'selh',                                    /* more selector call */
  120.  
  121. /*--------------------------------------------------------------
  122.         Keyword for recording
  123. --------------------------------------------------------------*/
  124.  
  125.     keyAERecorderCount = 'recr',                            /* available only in vers 1.0.1 and greater */
  126.  
  127. /*--------------------------------------------------------------
  128.         Keyword for version information
  129. --------------------------------------------------------------*/
  130.  
  131.     keyAEVersion = 'vers',                                    /* available only in vers 1.0.1 and greater */
  132.  
  133. /*--------------------------------------------------------------
  134.         Event Class
  135. --------------------------------------------------------------*/
  136.  
  137.     kCoreEventClass = 'aevt'
  138. };                                                            /* end of enum */
  139.  
  140. /*--------------------------------------------------------------
  141.         Event ID's
  142. --------------------------------------------------------------*/
  143.  
  144. enum {
  145.     kAEOpenApplication = 'oapp',
  146.     kAEOpenDocuments = 'odoc',
  147.     kAEPrintDocuments = 'pdoc',
  148.     kAEQuitApplication = 'quit',
  149.     kAEAnswer = 'ansr',
  150.     kAEApplicationDied = 'obit'
  151. };
  152.  
  153. /*--------------------------------------------------------------
  154.         Constants for use in AESend mode
  155. --------------------------------------------------------------*/
  156.  
  157. enum {
  158.     kAENoReply = 0x00000001,                                /* sender doesn't want a reply to event */
  159.     kAEQueueReply = 0x00000002,                                /* sender wants a reply but won't wait */
  160.     kAEWaitReply = 0x00000003,                                /* sender wants a reply and will wait */
  161.     kAENeverInteract = 0x00000010,                            /* server should not interact with user */
  162.     kAECanInteract = 0x00000020,                            /* server may try to interact with user */
  163.     kAEAlwaysInteract = 0x00000030,                            /* server should always interact with user where appropriate */
  164.     kAECanSwitchLayer = 0x00000040,                            /* interaction may switch layer */
  165.     kAEDontReconnect = 0x00000080,                            /* don't reconnect if there is a sessClosedErr from PPCToolbox */
  166.     kAEWantReceipt = nReturnReceipt,                        /* sender wants a receipt of message */
  167.     kAEDontRecord = 0x00001000,                                /* don't record this event - available only in vers 1.0.1 and greater */
  168.     kAEDontExecute = 0x00002000,                            /* don't send the event for recording - available only in vers 1.0.1 and greater */
  169.  
  170. /*--------------------------------------------------------------
  171.         Constants for the send priority in AESend
  172. --------------------------------------------------------------*/
  173.  
  174.     kAENormalPriority = 0x00000000,                            /* post message at the end of the event queue */
  175.     kAEHighPriority = nAttnMsg                                /* post message at the front of the event queue */
  176. };                                                            /* end of enum */
  177.  
  178. /*--------------------------------------------------------------
  179.         Constants for recording
  180. --------------------------------------------------------------*/
  181.  
  182. enum {
  183.     kAEStartRecording = 'reca',                                /* available only in vers 1.0.1 and greater */
  184.     kAEStopRecording = 'recc',                                /* available only in vers 1.0.1 and greater */
  185.     kAENotifyStartRecording = 'rec1',                        /* available only in vers 1.0.1 and greater */
  186.     kAENotifyStopRecording = 'rec0',                        /* available only in vers 1.0.1 and greater */
  187.     kAENotifyRecording = 'recr'                                /* available only in vers 1.0.1 and greater */
  188. };
  189.  
  190. /*--------------------------------------------------------------
  191.         Constant for the returnID param of AECreateAppleEvent
  192. --------------------------------------------------------------*/
  193.  
  194. enum {
  195.      kAutoGenerateReturnID = -1,                                /* AECreateAppleEvent will generate a session-unique ID */
  196.  
  197. /*--------------------------------------------------------------
  198.         Constant for transaction ID's
  199. --------------------------------------------------------------*/
  200.  
  201.     kAnyTransactionID = 0,                                    /* no transaction is in use */
  202.  
  203. /*--------------------------------------------------------------
  204.         Constants for timeout durations
  205. --------------------------------------------------------------*/
  206.  
  207.      kAEDefaultTimeout = -1,                                    /* timeout value determined by AEM */
  208.      kNoTimeOut = -2                                            /* wait until reply comes back, however long it takes */
  209. };                                                            /* end of enum */
  210.  
  211. /*--------------------------------------------------------------
  212.         Constants for AEResumeTheCurrentEvent
  213. --------------------------------------------------------------*/
  214.  
  215. enum {
  216.     kAENoDispatch=  0,                                        /* dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch */
  217.     kAEUseStandardDispatch = -1                                /* table, or one of these two constants */
  218.  
  219. };                                                            /* end of enum */
  220.  
  221. /*--------------------------------------------------------------
  222.         Apple event manager data types
  223. --------------------------------------------------------------*/
  224.  
  225. typedef unsigned long AEEventClass;
  226. typedef unsigned long AEEventID;
  227. typedef unsigned long AEKeyword;
  228. typedef ResType DescType;
  229.  
  230. struct AEDesc {
  231.      DescType descriptorType;
  232.      Handle dataHandle;
  233. };
  234. typedef struct AEDesc AEDesc;
  235.  
  236. struct AEKeyDesc {
  237.     AEKeyword descKey;
  238.     AEDesc descContent;
  239. };
  240. typedef struct AEKeyDesc AEKeyDesc;
  241.  
  242. typedef AEDesc AEAddressDesc;                                /* an AEDesc which contains address data */
  243. typedef AEDesc AEDescList;                                    /* a list of AEDesc's is a special kind of AEDesc */
  244. typedef AEDescList AERecord;                                /* AERecord is a list of keyworded AEDesc's */
  245. typedef AERecord AppleEvent;                                /* an AERecord that contains an AppleEvent */
  246.  
  247. typedef long AESendMode;                                    /* parameter to AESend */
  248. typedef short AESendPriority;                                /* priority param of AESend */
  249.  
  250. enum { kAEInteractWithSelf, kAEInteractWithLocal, kAEInteractWithAll };
  251. typedef unsigned char AEInteractAllowed;
  252.  
  253. enum { kAEUnknownSource, kAEDirectCall, kAESameProcess,
  254.        kAELocalProcess, kAERemoteProcess };
  255. typedef unsigned char AEEventSource;
  256.  
  257. enum { kAEDataArray, kAEPackedArray, kAEHandleArray, kAEDescArray,
  258.        kAEKeyDescArray };
  259. typedef unsigned char AEArrayType;
  260.  
  261. union AEArrayData {
  262.     short kAEDataArray[1];
  263.     char kAEPackedArray[1];
  264.     Handle kAEHandleArray[1];
  265.     AEDesc kAEDescArray[1];
  266.     AEKeyDesc kAEKeyDescArray[1];
  267. };
  268. typedef union AEArrayData AEArrayData;
  269.  
  270. typedef AEArrayData *AEArrayDataPointer;
  271.  
  272. typedef ProcPtr EventHandlerProcPtr;
  273. typedef ProcPtr IdleProcPtr;
  274. typedef ProcPtr EventFilterProcPtr;
  275.  
  276.  
  277. /*--------------------------------------------------------------
  278.         Apple event manager error messages
  279. --------------------------------------------------------------*/
  280.  
  281. enum {
  282.     errAECoercionFail = -1700,                                /* bad parameter data or unable to coerce the data supplied */
  283.     errAEDescNotFound = -1701,
  284.     errAECorruptData = -1702,
  285.     errAEWrongDataType = -1703,
  286.     errAENotAEDesc = -1704,
  287.     errAEBadListItem = -1705,                                /* the specified list item does not exist */
  288.     errAENewerVersion = -1706,                                /* need newer version of the AppleEvent manager */
  289.     errAENotAppleEvent = -1707,                                /* the event is not in AppleEvent format */
  290.     errAEEventNotHandled = -1708,                            /* the AppleEvent was not handled by any handler */
  291.     errAEReplyNotValid = -1709,                                /* AEResetTimer was passed an invalid reply parameter */
  292.     errAEUnknownSendMode = -1710,                            /* mode wasn't NoReply, WaitReply, or QueueReply or Interaction level is unknown */
  293.     errAEWaitCanceled = -1711,                                /* in AESend, the user cancelled out of wait loop for reply or receipt */
  294.     errAETimeout = -1712,                                    /* the AppleEvent timed out */
  295.     errAENoUserInteraction = -1713,                            /* no user interaction is allowed */
  296.     errAENotASpecialFunction = -1714,                        /* there is no special function for/with this keyword */
  297.     errAEParamMissed = -1715,                                /* a required parameter was not accessed */
  298.     errAEUnknownAddressType = -1716,                        /* the target address type is not known */
  299.     errAEHandlerNotFound = -1717,                            /* no handler in the dispatch tables fits the parameters to AEGetEventHandler or AEGetCoercionHandler */
  300.     errAEReplyNotArrived = -1718                            /* the contents of the reply you are accessing have not arrived yet */
  301. };
  302.  
  303. enum {                                                        /* error codes should be continued within this enum */
  304.     errAEIllegalIndex = -1719,                                /* index is out of range in a put operation */
  305.     errAEUnknownObjectType = -1731,                            /* available only in version 1.0.1 or greater */
  306.     errAERecordingIsAlreadyOn = -1732                        /* available only in version 1.0.1 or greater */
  307. };
  308.  
  309. #ifdef __cplusplus
  310. extern "C" {
  311. #endif
  312.  
  313. /**************************************************************************
  314.  The following calls apply to any AEDesc. Every 'result' descriptor is
  315.  created for you, so you will be responsible for memory management
  316.  (including disposing) of the descriptors so created. Note: purgeable
  317.  descriptor data is not supported - the AEM does not call LoadResource.  
  318. **************************************************************************/
  319.  
  320. pascal OSErr
  321. AECreateDesc( DescType typeCode, const void* dataPtr, Size dataSize, AEDesc *result )
  322.     = {0x303C,0x0825,0xA816};
  323.     
  324. pascal OSErr
  325. AECoercePtr( DescType typeCode, const void* dataPtr, Size dataSize, DescType toType,
  326.              AEDesc *result )
  327.     = {0x303C,0x0A02,0xA816}; 
  328.     
  329. pascal OSErr
  330. AECoerceDesc( const AEDesc *theAEDesc, DescType toType, AEDesc *result )
  331.     = {0x303C,0x0603,0xA816}; 
  332.     
  333. pascal OSErr
  334. AEDisposeDesc( AEDesc *theAEDesc )
  335.     = {0x303C,0x0204,0xA816};
  336.  
  337. pascal OSErr
  338. AEDuplicateDesc( const AEDesc *theAEDesc, AEDesc *result )
  339.     = {0x303C,0x0405,0xA816}; 
  340.  
  341.  
  342. /**************************************************************************
  343.   The following calls apply to AEDescList. Since AEDescList is a subtype of
  344.   AEDesc, the calls in the previous section can also be used for AEDescList.
  345.   All list and array indices are 1-based. If the data was greater than
  346.   maximumSize in the routines below, then actualSize will be greater than
  347.   maximumSize, but only maximumSize bytes will actually be retrieved.
  348. **************************************************************************/
  349.  
  350. pascal OSErr
  351. AECreateList( const void* factoringPtr, Size factoredSize, Boolean isRecord,
  352.               AEDescList *resultList )
  353.     = {0x303C,0x0706,0xA816}; 
  354.     
  355.     
  356. pascal OSErr
  357. AECountItems( const AEDescList *theAEDescList, long *theCount )
  358.     = {0x303C,0x0407,0xA816}; 
  359.     
  360. pascal OSErr
  361. AEPutPtr( const AEDescList *theAEDescList, long index, DescType typeCode,
  362.           const void* dataPtr, Size dataSize )
  363.     = {0x303C,0x0A08,0xA816};
  364.  
  365. pascal OSErr
  366. AEPutDesc( const AEDescList *theAEDescList, long index,
  367.            const AEDesc *theAEDesc )
  368.     = {0x303C,0x0609,0xA816}; 
  369.     
  370. pascal OSErr
  371. AEGetNthPtr( const AEDescList *theAEDescList, long index, DescType desiredType,
  372.              AEKeyword *theAEKeyword, DescType *typeCode, void* dataPtr,
  373.              Size maximumSize, Size *actualSize )
  374.     = {0x303C,0x100A,0xA816}; 
  375.     
  376. pascal OSErr
  377. AEGetNthDesc( const AEDescList *theAEDescList, long index, DescType desiredType,
  378.                AEKeyword *theAEKeyword, AEDesc *result )
  379.     = {0x303C,0x0A0B,0xA816}; 
  380.     
  381. pascal OSErr
  382. AESizeOfNthItem( const AEDescList *theAEDescList, long index,
  383.                  DescType *typeCode, Size *dataSize )
  384.     = {0x303C,0x082A,0xA816};
  385.  
  386. pascal OSErr
  387. AEGetArray( const AEDescList *theAEDescList, AEArrayType arrayType,
  388.             AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType,
  389.             Size *itemSize, long *itemCount )
  390.     = {0x303C,0x0D0C,0xA816}; 
  391.     
  392. pascal OSErr
  393. AEPutArray( const AEDescList *theAEDescList, AEArrayType arrayType,
  394.             const AEArrayDataPointer *arrayPtr, DescType itemType,
  395.             Size itemSize, long itemCount )
  396.     = {0x303C,0x0B0D,0xA816};
  397.  
  398. pascal OSErr
  399. AEDeleteItem( const AEDescList *theAEDescList, long index )
  400.     = {0x303C,0x040E,0xA816}; 
  401.  
  402.  
  403. /**************************************************************************
  404.  The following calls apply to AERecord. Since AERecord is a subtype of
  405.  AEDescList, the calls in the previous sections can also be used for
  406.  AERecord an AERecord can be created by using AECreateList with isRecord
  407.  set to true. 
  408. **************************************************************************/
  409.  
  410. pascal OSErr
  411. AEPutKeyPtr( const AERecord *theAERecord, AEKeyword theAEKeyword,
  412.              DescType typeCode, const void* dataPtr, Size dataSize )
  413.     = {0x303C,0x0A0F,0xA816};
  414.     
  415. pascal OSErr
  416. AEPutKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword,
  417.               const AEDesc *theAEDesc )
  418.     = {0x303C,0x0610,0xA816};
  419.  
  420. pascal OSErr
  421. AEGetKeyPtr( const AERecord *theAERecord, AEKeyword theAEKeyword,
  422.              DescType desiredType, DescType *typeCode, void* dataPtr,
  423.              Size maximumSize, Size *actualSize )
  424.     = {0x303C,0x0E11,0xA816};
  425.     
  426. pascal OSErr
  427. AEGetKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword,
  428.               DescType desiredType, AEDesc *result )
  429.     = {0x303C,0x0812,0xA816};
  430.     
  431. pascal OSErr
  432. AESizeOfKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword,
  433.                  DescType *typeCode, Size *dataSize )
  434.     = {0x303C,0x0829,0xA816};
  435.     
  436. pascal OSErr
  437. AEDeleteKeyDesc( const AERecord *theAERecord, AEKeyword theAEKeyword )
  438.     = {0x303C,0x0413,0xA816}; 
  439.  
  440.  
  441. /**************************************************************************
  442.   The following calls are used to pack and unpack parameters from records
  443.   of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
  444.   in the previous sections can also be used for variables of type
  445.   AppleEvent. The next six calls are in fact identical to the six calls
  446.   for AERecord.
  447. **************************************************************************/
  448.  
  449. pascal OSErr
  450. AEPutParamPtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  451.                DescType typeCode, const void* dataPtr, Size dataSize )
  452.     = {0x303C,0x0A0F,0xA816};
  453.     
  454. pascal OSErr
  455. AEPutParamDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  456.                 const AEDesc *theAEDesc )
  457.     = {0x303C,0x0610,0xA816};
  458.     
  459. pascal OSErr
  460. AEGetParamPtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  461.                DescType desiredType, DescType *typeCode, void* dataPtr,
  462.                Size maximumSize, Size *actualSize )
  463.     = {0x303C,0x0E11,0xA816};
  464.     
  465. pascal OSErr
  466. AEGetParamDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  467.                 DescType desiredType, AEDesc *result )
  468.     = {0x303C,0x0812,0xA816};
  469.     
  470. pascal OSErr
  471. AESizeOfParam( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  472.                DescType *typeCode, Size *dataSize )
  473.     = {0x303C,0x0829,0xA816};
  474.     
  475. pascal OSErr
  476. AEDeleteParam( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword )
  477.     = {0x303C,0x0413,0xA816}; 
  478.  
  479.  
  480. /**************************************************************************
  481.  The following calls also apply to type AppleEvent. Message attributes are
  482.  far more restricted, and can only be accessed through the following 5
  483.  calls. The various list and record routines cannot be used to access the
  484.  attributes of an event. 
  485. **************************************************************************/
  486.  
  487. pascal OSErr
  488. AEGetAttributePtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  489.                    DescType desiredType, DescType *typeCode, void* dataPtr,
  490.                    Size maximumSize, Size *actualSize )
  491.     = {0x303C,0x0E15,0xA816};
  492.     
  493. pascal OSErr
  494. AEGetAttributeDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  495.                     DescType desiredType, AEDesc *result )
  496.     = {0x303C,0x0826,0xA816};
  497.     
  498. pascal OSErr
  499. AESizeOfAttribute( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  500.                    DescType *typeCode, Size *dataSize )
  501.     = {0x303C,0x0828,0xA816};
  502.     
  503. pascal OSErr
  504. AEPutAttributePtr( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  505.                    DescType typeCode, const void* dataPtr, Size dataSize )
  506.     = {0x303C,0x0A16,0xA816};
  507.     
  508. pascal OSErr
  509. AEPutAttributeDesc( const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
  510.                     const AEDesc *theAEDesc )
  511.     = {0x303C,0x0627,0xA816}; 
  512.  
  513.  
  514. /**************************************************************************
  515.   The next couple of calls are basic routines used to create, send,
  516.   and process AppleEvents. 
  517. **************************************************************************/
  518.  
  519. pascal OSErr
  520. AECreateAppleEvent( AEEventClass theAEEventClass, AEEventID theAEEventID,
  521.                     const AEAddressDesc *target, short returnID,
  522.                     long transactionID, AppleEvent *result )
  523.     = {0x303C,0x0B14,0xA816};
  524.     
  525. pascal OSErr
  526. AESend( const AppleEvent *theAppleEvent, AppleEvent *reply,
  527.         AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks,
  528.         IdleProcPtr idleProc, EventFilterProcPtr filterProc )
  529.     = {0x303C,0x0D17,0xA816};
  530.     
  531. pascal OSErr
  532. AEProcessAppleEvent( const EventRecord *theEventRecord )
  533.     = {0x303C,0x021B,0xA816}; 
  534.  
  535. /* 
  536.  Note: during event processing, an event handler may realize that it is likely
  537.  to exceed the client's timeout limit. Passing the reply to this
  538.  routine causes a wait event to be generated that asks the client
  539.  for more time. 
  540. */
  541.  
  542. pascal OSErr
  543. AEResetTimer( const AppleEvent *reply )
  544.     = {0x303C,0x0219,0xA816}; 
  545.  
  546.  
  547. /**************************************************************************
  548.  The following four calls are available for applications which need more
  549.  sophisticated control over when and how events are processed. Applications
  550.  which implement multi-session servers or which implement their own
  551.  internal event queueing will probably be the major clients of these
  552.  routines. They can be called from within a handler to prevent the AEM from
  553.  disposing of the AppleEvent when the handler returns. They can be used to
  554.  asynchronously process the event (as MacApp does).
  555. **************************************************************************/
  556.  
  557. pascal OSErr
  558. AESuspendTheCurrentEvent( const AppleEvent *theAppleEvent )
  559.     = {0x303C,0x022B,0xA816}; 
  560.  
  561. /* 
  562.  Note: The following routine tells the AppleEvent manager that processing
  563.  is either about to resume or has been completed on a previously suspended
  564.  event. The procPtr passed in as the dispatcher parameter will be called to
  565.  attempt to redispatch the event. Several constants for the dispatcher
  566.  parameter allow special behavior. They are:
  567.       - kAEUseStandardDispatch means redispatch as if the event was just
  568.       received, using the standard AppleEvent dispatch mechanism.
  569.       - kAENoDispatch means ignore the parameter.
  570.          Use this in the case where the event has been handled and no
  571.       redispatch is needed.
  572.       - non nil means call the routine which the dispatcher points to.
  573. */
  574.  
  575. pascal OSErr
  576. AEResumeTheCurrentEvent( const AppleEvent *theAppleEvent,
  577.                          const AppleEvent *reply,
  578.                          EventHandlerProcPtr dispatcher, long handlerRefcon )
  579.     = {0x303C,0x0818,0xA816};
  580.     
  581. pascal OSErr
  582. AEGetTheCurrentEvent( AppleEvent *theAppleEvent )
  583.     = {0x303C,0x021A,0xA816};
  584.     
  585. pascal OSErr
  586. AESetTheCurrentEvent( const AppleEvent *theAppleEvent )
  587.     = {0x303C,0x022C,0xA816}; 
  588.  
  589.  
  590. /**************************************************************************
  591.   The following three calls are used to allow applications to behave
  592.   courteously when a user interaction such as a dialog box is needed. 
  593. **************************************************************************/
  594.  
  595. pascal OSErr
  596. AEGetInteractionAllowed( AEInteractAllowed *level )
  597.     = {0x303C,0x021D,0xA816};
  598.     
  599. pascal OSErr
  600. AESetInteractionAllowed( AEInteractAllowed level )
  601.     = {0x303C,0x011E,0xA816};
  602.     
  603. pascal OSErr
  604. AEInteractWithUser( long timeOutInTicks, NMRecPtr nmReqPtr,
  605.                     IdleProcPtr idleProc )
  606.     = {0x303C,0x061C,0xA816}; 
  607.  
  608.  
  609. /**************************************************************************
  610.   These calls are used to set up and modify the event dispatch table.
  611. **************************************************************************/
  612.  
  613. pascal OSErr
  614. AEInstallEventHandler( AEEventClass theAEEventClass, AEEventID theAEEventID,
  615.                        EventHandlerProcPtr handler, long handlerRefcon,
  616.                        Boolean isSysHandler )
  617.     = {0x303C,0x091F,0xA816};
  618.     
  619. pascal OSErr
  620. AERemoveEventHandler( AEEventClass theAEEventClass, AEEventID theAEEventID,
  621.                       EventHandlerProcPtr handler, Boolean isSysHandler )
  622.     = {0x303C,0x0720,0xA816};
  623.     
  624. pascal OSErr
  625. AEGetEventHandler( AEEventClass theAEEventClass, AEEventID theAEEventID,
  626.                    EventHandlerProcPtr *handler, long *handlerRefcon,
  627.                    Boolean isSysHandler )
  628.     = {0x303C,0x0921,0xA816}; 
  629.  
  630.  
  631. /**************************************************************************
  632.   These calls are used to set up and modify the coercion dispatch table.
  633. **************************************************************************/
  634.  
  635. pascal OSErr
  636. AEInstallCoercionHandler( DescType fromType, DescType toType, ProcPtr handler,
  637.                           long handlerRefcon, Boolean fromTypeIsDesc,
  638.                           Boolean isSysHandler )
  639.     = {0x303C,0x0A22,0xA816};
  640.     
  641. pascal OSErr
  642. AERemoveCoercionHandler( DescType fromType, DescType toType, ProcPtr handler,
  643.                          Boolean isSysHandler )
  644.     = {0x303C,0x0723,0xA816};
  645.     
  646. pascal OSErr
  647. AEGetCoercionHandler( DescType fromType, DescType toType, ProcPtr *handler,
  648.                       long *handlerRefcon, Boolean *fromTypeIsDesc,
  649.                       Boolean isSysHandler )
  650.     = {0x303C,0x0B24,0xA816}; 
  651.  
  652.  
  653. /**************************************************************************
  654.   These calls are used to set up and modify special hooks into the
  655.   AppleEvent manager.
  656. **************************************************************************/
  657.  
  658. pascal OSErr
  659. AEInstallSpecialHandler( AEKeyword functionClass, ProcPtr handler,
  660.                          Boolean isSysHandler )
  661.     = {0x303C,0x0500,0xA816};
  662.     
  663. pascal OSErr
  664. AERemoveSpecialHandler( AEKeyword functionClass, ProcPtr handler,
  665.                         Boolean isSysHandler )
  666.     = {0x303C,0x0501,0xA816}; 
  667.  
  668. pascal OSErr
  669. AEGetSpecialHandler( AEKeyword functionClass, ProcPtr *handler,
  670.                      Boolean isSysHandler )
  671.     = {0x303C,0x052D,0xA816}; 
  672.  
  673.  
  674. /**************************************************************************
  675.   This call was added in version 1.0.1. If called with the keyword
  676.   keyAERecorderCount ('recr'), the number of recorders that are
  677.   currently active is returned in 'result'.
  678. **************************************************************************/
  679.  
  680. /* available only in vers 1.0.1 and greater */
  681. pascal OSErr
  682. AEManagerInfo( AEKeyword keyWord, long *result )
  683.     = {0x303C,0x0441,0xA816};
  684.  
  685.  
  686. #ifdef __cplusplus
  687. }
  688. #endif
  689.  
  690. #endif
  691.